package cn.vc.communityservice.service;

import cn.vc.communityservice.entity.CommunityAttention;
import cn.vc.communityservice.mapper.CommunityAttentionMapper;
import org.springframework.stereotype.Service;

@Service
public class CommunityAttentionService {
    private final CommunityAttentionMapper communityAttentionMapper;

    public CommunityAttentionService(CommunityAttentionMapper communityAttentionMapper) {
        this.communityAttentionMapper = communityAttentionMapper;
    }



    public boolean attention(Long communityId, Long userId) {
        return communityAttentionMapper.insert(new CommunityAttention(communityId, userId))==1;
    }



    public boolean deleteById(Long id) {
        return communityAttentionMapper.deleteById(id)==1;
    }
}
